﻿/******************************************************************************
 * Name         : LoginPlayer.cpp
 * Author       : 671643387
 * Date         : 2015年9月14日
 * Description  :
 *****************************************************************************/

#include <common/logger/Logger.hpp>
#include "LoginPlayerManager.hpp"
#include "LoginPlayer.hpp"
using namespace sxr;
using namespace sxr::login_server;

LoginPlayer::LoginPlayer(int id, dev::net::TcpConnectionPtr& conn)
: Player(id, conn)
{
    common::getLogger()->log("New LoginPlayer %d", id);
}

LoginPlayer::~LoginPlayer()
{
    common::getLogger()->log("Destroy LoginPlayer %d", id_);
}

bool LoginPlayer::executePacket(common::PacketPtr packet)
{
    return Player::executePacket(packet);
}

void LoginPlayer::onRemovePlayer()
{
    LoginPlayerManager::getMe()->removePlayer(*this);
}